﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace IniTechCaash.Domain.Entities
{
    /// <summary>
    /// An entry into the General Journal. 
    /// </summary>
    public class JournalEntry : AuditableEntity
    {
        /// <summary>
        /// Date this <see cref="JournalEntry"/>'s lines were posted to thier respective accounts. 
        /// </summary>
        public DateTime? DatePosted { get; set; }

        public override string Descriptive
        {
            get { return "JNE"; }
        }

        /// <summary>
        /// Whether this line has been posted to its respective <see cref="Account"/>. 
        /// </summary>
        public bool IsPosted { get; set; }

        /// <summary>
        /// A descriptive name of this <see cref="JournalEntry"/>
        /// </summary>
        [StringLength(128)]
        public string Name { get; set; }

        /// <summary>
        /// List of <see cref="JournalEntryLine"/>s in this <see cref="JournalEntry"/>. 
        /// </summary>
        public virtual IList<JournalEntryLine> Lines { get; set; }

        ///// <summary>
        ///// The <see cref="SourceDocument"/> associated with the event that caused this <see cref="JournalEntry"/>. 
        ///// </summary>
        //public virtual SourceDocument SourceDocument { get; set; }
    }
}
